package com.javabasestage2.enumeration;

/**
 * @author 冯智仁
 * @version 9.9
 */
public class enumExercise01 {
    public static void main(String[] args) {
        Gender boy = Gender.BOY;
        Gender boy2 = Gender.BOY;
        System.out.println(boy);//相当于调用Gender类的BOY
        System.out.println(boy == boy2); //本质就是调用Gender的父类
        System.out.println(Gender.BOY);
    }
}

/**
 * Enum 的 toString()
 * public String toString(){
 *     return name;
 * }
 */
enum Gender{//父类 Enum 的toString
    BOY , GIRL
}

